/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lomext.ext;

import lomext.lom.Schema.General;
import org.htmlparser.util.NodeList;

/**
 *
 * @author User
 */
public class ExtratorGeneral{
    Extrator extrator;
    private General general;

    public ExtratorGeneral(Extrator extrator) {
        this.general = new General();
        this.extrator = extrator;
    }
    
    public void extrairAtributosGeneral(){
        general.setTitle(getTitle());
    }

    public String getTitle() {
        NodeList extrairNodesPorTag = this.extrator.extrairNodesPorTag("h1");       
        return extrairNodesPorTag.elementAt(0).toPlainTextString();
    }
    
    public String getLanguage(){
        NodeList extrairNodesPorTag = this.extrator.extrairAtributoPorTag("","lang");       
        return extrairNodesPorTag.elementAt(0).getFirstChild().toHtml();
    }
    
}
